﻿using System;
using System.Configuration;

namespace Data
{
    public static class DBConfig
    {
        private static string _ConnectionSettings;
        /// <summary>
        /// 数据库链接
        /// </summary>
        public static string ConnectionSettings
        {
            get { return "Server=123.56.94.54;Database=cpmimi;uid=cpmimi;pwd=45a4e8s7tsagy"; }
           //get { return "Server=.;Database=SXCPDbo;uid=sa;pwd=123"; }
            set { DBConfig._ConnectionSettings = value; }
        }

        public static DateTime Begindate
        {
            get {
                try
                {
                    string begindate = System.Configuration.ConfigurationManager.ConnectionStrings["web_begindate"].ConnectionString;
                    if (begindate != null && begindate.Length > 4)
                    {
                        return Convert.ToDateTime(begindate);
                    }
                }
                catch {}
                return new DateTime(2015, 9, 1);
            }         
        }
    }
}
